package com.example.rabbitmqspringboot.consumer;/**
 * @program: rabbitmqSpringBoot
 * @author: xlk
 * @create: 2024-04-03 15:44
 */

import com.example.rabbitmqspringboot.constant.BackupConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
/**
 @auther teacher
 @date 2024/4/3
 @project rabbitmqSpringBoot
 */
@Slf4j
@Component
public class WarningConsumer {
    @RabbitListener(queues = BackupConstant.WARING_QUEUE)
    public void receiveD(Message message) throws Exception {
        String msg = new String(message.getBody());
        log.warn("告警队列收到信息：{}", msg);
    }
}